import matplotlib
from numpy.random import randn
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import string
import numpy as np

if __name__ == '__main__':
    K = [10, 20, 30, 40, 50, 60, 70, 80, 100]
    MAE = [0.8036821230216589, 0.7812911455793186, 0.7751827503696274, 0.7730402767858237,
           0.7722654764883726, 0.7707550450162645, 0.7715985485072734, 0.772333231183126, 0.7756486410871429]
    plt.fill_between(K, MAE, 0.76, color='green')
    plt.xlabel('K')
    plt.ylabel('MAE')
    plt.title('The observed values MAE in different neighbor K  ')
    plt.yticks([0.76, 0.77, 0.78, 0.79, 0.80], ['0.76', '0.77', '0.78', '0.79', '0.80'])
    plt.grid(True)
    plt.show()
